/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jims.master.modules.patient.myRecord.service;


import com.jims.master.common.service.CrudService;
import com.jims.master.modules.patient.myRecord.dao.CasePrescDao;
import com.jims.master.modules.patient.myRecord.entity.CasePresc;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

/**
 * 用于病历同步中门诊医嘱明细Service
 * @author xueyx
 * @version 2016-07-06
 */
@Service
@Transactional(readOnly = true)
public class CasePrescService extends CrudService<CasePrescDao, CasePresc> {

    /**
     * 获取病人每次门诊记录
     * @param patientId
     * @param visitDate
     * @return
     */
    public CasePresc getNetPresc(String patientId,Date visitDate){
        CasePresc casePresc=dao.getNetPresc(patientId, visitDate);
        return casePresc;
    }

    public  List<CasePresc> selelctNetPresc(String patientId,String visitNo,String visitDate){
        List<CasePresc> casePrescList=dao.selectNetPresc(patientId, visitNo, visitDate);
        return casePrescList;
    }

    /**
     * 获取病人处方信息
     * @param patientId
     * @param visitDate
     * @return
     */
    /*public List<CasePresc> list(String patientId,Date visitDate){
        CasePresc casePresc=dao.getNetPresc(patientId, visitDate);
        return casePresc;
    }*/

    /**
     * 获得患者未传送的信息
     * @return
     */
    public List<CasePresc> getInfoToSend(CasePresc casePresc){
        return dao.getInfoToSend(casePresc);
    }
    //改变发送标志
    @Transactional(readOnly = false)
    public Integer send(CasePresc casePresc){
        return dao.send(casePresc);
    }

    /***
     * 由处方单号查询处方明细
     * @param casePresc
     * @return
     */
    public List<CasePresc> getNetPrescByPrescNo(CasePresc casePresc){
        return dao.getNetPrescByPrescNo(casePresc);
    }
}